-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update TxProposalProcedures type to make invalid states irrepresentable #726
Update TxProposalProcedures type to make invalid states irrepresentable #726
Conversation
8c7adb6
to
3193e8c
Compare
3193e8c
to
1616394
Compare
dd422b5
to
567e8c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
-> BuildTxWith build (Map (L.ProposalProcedure (ShelleyLedgerEra era)) (ScriptWitness WitCtxStake era)) | ||
-- ^ a map of witnesses for the proposals. If the proposals are not added to the first constructor | ||
-- parameter too, the sky will fall on your head. | ||
=> OMap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly necessary for this PR but we ought to start adding haddocks as we go along for these types.
E.g
-- | A proposal procedure houses a governance action that is required to be voted into acceptance when submitted.
I'll be asking everyone in future PRs to potentially add succinct summaries to share the documentation load fairly.
567e8c2
to
fbade80
Compare
Changelog
Context
Previously
TxProposalProcedures
was not guaranteeing the type consistency: when used, you could insert proposals only to its second argument without inserting it to the first. The logic incardano-api
relies on a fact that the first argument would contain a complete list of proposals, so this would introduce a bug.This PR changes
TxProposalProcedures
constructor to make it contain a single ordered map instead of both ordered set and a witness map.Checklist